import React from 'react';
import { ConfigProvider, Spin } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import ReactDOM from 'react-dom/client';
import { RouterProvider } from 'react-router-dom';
import { FcNavigateProvider } from './router/hooks/useFcNavigate';

import router, { routeUrlMap } from '@/router/index';
import './index.scss';

ReactDOM.createRoot(document.getElementById('root')!).render(
  // <React.StrictMode>
    <ConfigProvider locale={zhCN}>
      <FcNavigateProvider value={routeUrlMap}>
        <RouterProvider
          router={router}
          fallbackElement={
            <div className="w-full h-full flex justify-center items-center">
              <Spin size="large" />
            </div>
          }
        />
      </FcNavigateProvider>
    </ConfigProvider>
  // </React.StrictMode>,
);
